<template>
  <view class="container">

	<view style="margin-bottom: 10px;">
		<text><text style="color: red;">*</text>商户编号</text>
	</view>
	<u-input v-model="origina.traderNumber" :disabled="true" placeholder="请输入商户编号" style="margin-bottom: 10px;"></u-input>
	
	<view style="margin-bottom: 10px;">
		<text><text style="color: red;"></text>商户名称</text>
	</view>
	<u-input v-model="origina.traderName" :disabled="true" placeholder="请输入商户名称" style="margin-bottom: 10px;"></u-input>
	
	<view style="margin-bottom: 10px;">
		<text><text style="color: red;"></text>商户手机号</text>
	</view>
	<u-input v-model="origina.traderPhonenumber" :disabled="true" placeholder="未填写" style="margin-bottom: 10px;"></u-input>
  <view style="margin-bottom: 10px;">
		<text>状态</text>
			<text style="margin-left: 20px;" :style="{ color: origina.state === '0' ? 'green' : 'red' }">{{ origina.state === '0' ? '未授权' : origina.state === '1' ? '已被授权' : '未知状态' }}</text>
		
	</view>

		  
    <!-- 原始二维码图片 -->
		<text style="margin-top: 200px;"><text style="color: red;">*</text>原始二维码图片</text>
		<view class="upload-container">
		
		<u-upload :fileList="fileList" 
		
		name="1" 
		:multiple="false" 
		:maxCount="1"
		 width="200rpx" 
		 height="200rpx" 
		 
		  >
				    <!-- 这张图片就是自定义的图片，地址填写自己本地的就行 -->
		</u-upload>
		
        </view>


 



 
 </view>
</template>

<script>
import { getToken,setToken,TokenKey } from '@/utils/auth'
import {addOriginalQRcode,getOriginalQRcode} from '@/api/system/originalQRcode.js'

export default {
	
	inject: ['baseUrl'],
	onLoad(options) {
	    if (options && options.id) {
	        this.id = options.id;
	        console.log(this.id); // 确保这里输出正确的id
	
	       getOriginalQRcode(this.id).then(res => {
	           this.origina = res.data;
	           if (this.origina && this.origina.originalQrCode) {
	               this.fileList = [{
	                   url: this.baseUrl + this.origina.originalQrCode
	               }];
	           }
	       });
}
	},

  data() {
    return {
	id: null,
	origina: {},
	
	fileList: null,
    };
  },


  methods: {
   
},

}; 
</script>

<style scoped>
.container {
  padding: 20px;
}

.upload-container {
  margin-top: 10px; /* 控制上传组件与标签的间距 */
}

.button-container {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}
</style>
